Optimal. Leaf size=271 \[ -\frac {i (c+d x)^3}{3 a^2 f}+\frac {2 d (c+d x)^2 \log \left (1+e^{i (e+f x)}\right )}{a^2 f^2}+\frac {4 d^3 \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a^2 f^4}-\frac {4 i d^2 (c+d x) \text {PolyLog}\left (2,-e^{i (e+f x)}\right )}{a^2 f^3}+\frac {4 d^3 \text {PolyLog}\left (3,-e^{i (e+f x)}\right )}{a^2 f^4}-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}+\frac {2 d^2 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{a^2 f^3}+\frac {(c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x)^3 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.24, antiderivative size = 271, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 9, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.450, Rules used = {3399, 4271,
4269, 3556, 3800, 2221, 2611, 2320, 6724} \begin {gather*} -\frac {4 i d^2 (c+d x) \text {Li}_2\left (-e^{i (e+f x)}\right )}{a^2 f^3}+\frac {2 d^2 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{a^2 f^3}+\frac {2 d (c+d x)^2 \log \left (1+e^{i (e+f x)}\right )}{a^2 f^2}-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}+\frac {(c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}-\frac {i (c+d x)^3}{3 a^2 f}+\frac {4 d^3 \text {Li}_3\left (-e^{i (e+f x)}\right )}{a^2 f^4}+\frac {4 d^3 \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a^2 f^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2320
Rule 2611
Rule 3399
Rule 3556
Rule 3800
Rule 4269
Rule 4271
Rule 6724
Rubi steps
\begin {align*} \int \frac {(c+d x)^3}{(a+a \cos (e+f x))^2} \, dx &=\frac {\int (c+d x)^3 \csc ^4\left (\frac {e+\pi }{2}+\frac {f x}{2}\right ) \, dx}{4 a^2}\\ &=-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}+\frac {(c+d x)^3 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}+\frac {\int (c+d x)^3 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{6 a^2}+\frac {d^2 \int (c+d x) \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{a^2 f^2}\\ &=-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}+\frac {2 d^2 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{a^2 f^3}+\frac {(c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x)^3 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}-\frac {\left (2 d^3\right ) \int \tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{a^2 f^3}-\frac {d \int (c+d x)^2 \tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{a^2 f}\\ &=-\frac {i (c+d x)^3}{3 a^2 f}+\frac {4 d^3 \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a^2 f^4}-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}+\frac {2 d^2 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{a^2 f^3}+\frac {(c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x)^3 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}+\frac {(2 i d) \int \frac {e^{2 i \left (\frac {e}{2}+\frac {f x}{2}\right )} (c+d x)^2}{1+e^{2 i \left (\frac {e}{2}+\frac {f x}{2}\right )}} \, dx}{a^2 f}\\ &=-\frac {i (c+d x)^3}{3 a^2 f}+\frac {2 d (c+d x)^2 \log \left (1+e^{i (e+f x)}\right )}{a^2 f^2}+\frac {4 d^3 \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a^2 f^4}-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}+\frac {2 d^2 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{a^2 f^3}+\frac {(c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x)^3 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}-\frac {\left (4 d^2\right ) \int (c+d x) \log \left (1+e^{2 i \left (\frac {e}{2}+\frac {f x}{2}\right )}\right ) \, dx}{a^2 f^2}\\ &=-\frac {i (c+d x)^3}{3 a^2 f}+\frac {2 d (c+d x)^2 \log \left (1+e^{i (e+f x)}\right )}{a^2 f^2}+\frac {4 d^3 \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a^2 f^4}-\frac {4 i d^2 (c+d x) \text {Li}_2\left (-e^{i (e+f x)}\right )}{a^2 f^3}-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}+\frac {2 d^2 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{a^2 f^3}+\frac {(c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x)^3 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}+\frac {\left (4 i d^3\right ) \int \text {Li}_2\left (-e^{2 i \left (\frac {e}{2}+\frac {f x}{2}\right )}\right ) \, dx}{a^2 f^3}\\ &=-\frac {i (c+d x)^3}{3 a^2 f}+\frac {2 d (c+d x)^2 \log \left (1+e^{i (e+f x)}\right )}{a^2 f^2}+\frac {4 d^3 \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a^2 f^4}-\frac {4 i d^2 (c+d x) \text {Li}_2\left (-e^{i (e+f x)}\right )}{a^2 f^3}-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}+\frac {2 d^2 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{a^2 f^3}+\frac {(c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x)^3 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}+\frac {\left (4 d^3\right ) \text {Subst}\left (\int \frac {\text {Li}_2(-x)}{x} \, dx,x,e^{2 i \left (\frac {e}{2}+\frac {f x}{2}\right )}\right )}{a^2 f^4}\\ &=-\frac {i (c+d x)^3}{3 a^2 f}+\frac {2 d (c+d x)^2 \log \left (1+e^{i (e+f x)}\right )}{a^2 f^2}+\frac {4 d^3 \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{a^2 f^4}-\frac {4 i d^2 (c+d x) \text {Li}_2\left (-e^{i (e+f x)}\right )}{a^2 f^3}+\frac {4 d^3 \text {Li}_3\left (-e^{i (e+f x)}\right )}{a^2 f^4}-\frac {d (c+d x)^2 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{2 a^2 f^2}+\frac {2 d^2 (c+d x) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{a^2 f^3}+\frac {(c+d x)^3 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x)^3 \sec ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.69, size = 250, normalized size = 0.92 \begin {gather*} \frac {2 \cos \left (\frac {1}{2} (e+f x)\right ) \left (-3 d f^2 (c+d x)^2 \cos \left (\frac {1}{2} (e+f x)\right )+f^3 (c+d x)^3 \sin \left (\frac {1}{2} (e+f x)\right )+12 d^2 \cos ^3\left (\frac {1}{2} (e+f x)\right ) \left (2 d \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )+f (c+d x) \tan \left (\frac {1}{2} (e+f x)\right )\right )-2 \cos ^3\left (\frac {1}{2} (e+f x)\right ) \left (i f^3 (c+d x)^3-6 d \left (f^2 (c+d x)^2 \log \left (1+e^{i (e+f x)}\right )-2 i d f (c+d x) \text {PolyLog}\left (2,-e^{i (e+f x)}\right )+2 d^2 \text {PolyLog}\left (3,-e^{i (e+f x)}\right )\right )-f^3 (c+d x)^3 \tan \left (\frac {1}{2} (e+f x)\right )\right )\right )}{3 a^2 f^4 (1+\cos (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 677 vs. \(2 (231 ) = 462\).
time = 0.49, size = 678, normalized size = 2.50
method | result | size |
risch | \(\frac {4 i d^{3} e^{3}}{3 a^{2} f^{4}}-\frac {2 i d^{3} x^{3}}{3 a^{2} f}+\frac {2 i \left (3 i c^{2} d f \,{\mathrm e}^{2 i \left (f x +e \right )}+3 d^{3} f^{2} x^{3} {\mathrm e}^{i \left (f x +e \right )}+3 i c^{2} d f \,{\mathrm e}^{i \left (f x +e \right )}+3 i d^{3} f \,x^{2} {\mathrm e}^{i \left (f x +e \right )}+9 c \,d^{2} f^{2} x^{2} {\mathrm e}^{i \left (f x +e \right )}+d^{3} f^{2} x^{3}+6 i c \,d^{2} f x \,{\mathrm e}^{i \left (f x +e \right )}+3 i d^{3} f \,x^{2} {\mathrm e}^{2 i \left (f x +e \right )}+9 c^{2} d \,f^{2} x \,{\mathrm e}^{i \left (f x +e \right )}+3 c \,d^{2} f^{2} x^{2}+6 i c \,d^{2} f x \,{\mathrm e}^{2 i \left (f x +e \right )}+3 c^{3} f^{2} {\mathrm e}^{i \left (f x +e \right )}+3 c^{2} d \,f^{2} x +6 d^{3} x \,{\mathrm e}^{2 i \left (f x +e \right )}+c^{3} f^{2}+6 c \,d^{2} {\mathrm e}^{2 i \left (f x +e \right )}+12 d^{3} x \,{\mathrm e}^{i \left (f x +e \right )}+12 c \,d^{2} {\mathrm e}^{i \left (f x +e \right )}+6 d^{3} x +6 c \,d^{2}\right )}{3 f^{3} a^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )^{3}}+\frac {2 i d^{3} e^{2} x}{a^{2} f^{3}}+\frac {2 d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) x^{2}}{a^{2} f^{2}}-\frac {4 i d^{2} c \polylog \left (2, -{\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{3}}-\frac {2 i d^{2} c \,x^{2}}{a^{2} f}-\frac {4 i d^{3} \polylog \left (2, -{\mathrm e}^{i \left (f x +e \right )}\right ) x}{a^{2} f^{3}}+\frac {2 d \,c^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{a^{2} f^{2}}-\frac {2 d \,c^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{2}}-\frac {2 d^{3} e^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{4}}-\frac {4 i d^{2} c e x}{a^{2} f^{2}}+\frac {4 d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) c x}{a^{2} f^{2}}+\frac {4 d^{3} \polylog \left (3, -{\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{4}}+\frac {4 d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{a^{2} f^{4}}-\frac {4 d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{4}}+\frac {4 d^{2} c e \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a^{2} f^{3}}-\frac {2 i d^{2} c \,e^{2}}{a^{2} f^{3}}\) | \(678\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 3441 vs. \(2 (237) = 474\).
time = 0.92, size = 3441, normalized size = 12.70 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 800 vs. \(2 (237) = 474\).
time = 0.41, size = 800, normalized size = 2.95 \begin {gather*} -\frac {3 \, d^{3} f^{2} x^{2} + 6 \, c d^{2} f^{2} x + 3 \, c^{2} d f^{2} + 3 \, {\left (d^{3} f^{2} x^{2} + 2 \, c d^{2} f^{2} x + c^{2} d f^{2}\right )} \cos \left (f x + e\right ) + 6 \, {\left (-i \, d^{3} f x - i \, c d^{2} f + {\left (-i \, d^{3} f x - i \, c d^{2} f\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (-i \, d^{3} f x - i \, c d^{2} f\right )} \cos \left (f x + e\right )\right )} {\rm Li}_2\left (-\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right ) + 6 \, {\left (i \, d^{3} f x + i \, c d^{2} f + {\left (i \, d^{3} f x + i \, c d^{2} f\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (i \, d^{3} f x + i \, c d^{2} f\right )} \cos \left (f x + e\right )\right )} {\rm Li}_2\left (-\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right ) - 3 \, {\left (d^{3} f^{2} x^{2} + 2 \, c d^{2} f^{2} x + c^{2} d f^{2} + 2 \, d^{3} + {\left (d^{3} f^{2} x^{2} + 2 \, c d^{2} f^{2} x + c^{2} d f^{2} + 2 \, d^{3}\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (d^{3} f^{2} x^{2} + 2 \, c d^{2} f^{2} x + c^{2} d f^{2} + 2 \, d^{3}\right )} \cos \left (f x + e\right )\right )} \log \left (\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (d^{3} f^{2} x^{2} + 2 \, c d^{2} f^{2} x + c^{2} d f^{2} + 2 \, d^{3} + {\left (d^{3} f^{2} x^{2} + 2 \, c d^{2} f^{2} x + c^{2} d f^{2} + 2 \, d^{3}\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (d^{3} f^{2} x^{2} + 2 \, c d^{2} f^{2} x + c^{2} d f^{2} + 2 \, d^{3}\right )} \cos \left (f x + e\right )\right )} \log \left (\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right ) + 1\right ) - 6 \, {\left (d^{3} \cos \left (f x + e\right )^{2} + 2 \, d^{3} \cos \left (f x + e\right ) + d^{3}\right )} {\rm polylog}\left (3, -\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right ) - 6 \, {\left (d^{3} \cos \left (f x + e\right )^{2} + 2 \, d^{3} \cos \left (f x + e\right ) + d^{3}\right )} {\rm polylog}\left (3, -\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right ) - {\left (2 \, d^{3} f^{3} x^{3} + 6 \, c d^{2} f^{3} x^{2} + 2 \, c^{3} f^{3} + 6 \, c d^{2} f + 6 \, {\left (c^{2} d f^{3} + d^{3} f\right )} x + {\left (d^{3} f^{3} x^{3} + 3 \, c d^{2} f^{3} x^{2} + c^{3} f^{3} + 6 \, c d^{2} f + 3 \, {\left (c^{2} d f^{3} + 2 \, d^{3} f\right )} x\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{3 \, {\left (a^{2} f^{4} \cos \left (f x + e\right )^{2} + 2 \, a^{2} f^{4} \cos \left (f x + e\right ) + a^{2} f^{4}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {c^{3}}{\cos ^{2}{\left (e + f x \right )} + 2 \cos {\left (e + f x \right )} + 1}\, dx + \int \frac {d^{3} x^{3}}{\cos ^{2}{\left (e + f x \right )} + 2 \cos {\left (e + f x \right )} + 1}\, dx + \int \frac {3 c d^{2} x^{2}}{\cos ^{2}{\left (e + f x \right )} + 2 \cos {\left (e + f x \right )} + 1}\, dx + \int \frac {3 c^{2} d x}{\cos ^{2}{\left (e + f x \right )} + 2 \cos {\left (e + f x \right )} + 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F(-1)]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \text {Hanged} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________